package gui;


import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import javax.swing.JButton;

import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;

import javax.swing.JLabel;
import javax.swing.JTabbedPane;
import javax.swing.JTextField;
import javax.swing.JComboBox;
import javax.swing.DefaultComboBoxModel;
import javax.swing.ImageIcon;

import java.awt.Color;
import java.awt.Font;

@SuppressWarnings("serial")
public class ArchieveWorkerWindow extends JFrame {

	private JPanel contentPane;
	private JTextField pictureNameTextField;
	private JTextField locationTextField;
	private JTextField timeTextField;
	private JTextField resolutionTextField;
	private JTextField priceTextField;
	private JTextField sizeTextField;
	private JTextField picIDRemovePicTextField;
	private JTextField picIDAddLayerTextField;
	private JTextField picIDRemoveLayerTextField;
	private JPanel removePicturePanel ;
	private JPanel addPicturePanel;
	private JPanel removeLayerpanel;
	private JPanel addLayerPanel ;

	/**
	 * Create the frame.
	 */
	public ArchieveWorkerWindow() {
		
		setTitle("Archieve Worker");
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		setBounds(250, 30, 800, 600);
		
		contentPane = new JPanel();
		contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
		setContentPane(contentPane);
		contentPane.setLayout(null);
		
		JButton btnLogOut = new JButton("Log Out");
		btnLogOut.setBackground(new Color(0, 0, 0));
		btnLogOut.setForeground(new Color(0, 255, 255));
		btnLogOut.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent arg0) {
				MainWindow mainWindowframe = new MainWindow();
				mainWindowframe.setVisible(true);
				dispose();
			}
		});
		btnLogOut.setBounds(509, 506, 117, 29);
		contentPane.add(btnLogOut);
		
		JTabbedPane tabbedPane = new JTabbedPane(JTabbedPane.TOP);
		tabbedPane.setFont(new Font("Monaco", Font.BOLD, 13));
		tabbedPane.setBackground(Color.WHITE);
		tabbedPane.setBounds(23, 201, 716, 162);
		contentPane.add(tabbedPane);
		
		addPicturePanel = new JPanel();
		addPicturePanel.setBackground(new Color(0, 0, 0));
		tabbedPane.addTab("Add a Picture", null, addPicturePanel, null);
		tabbedPane.setForegroundAt(0, new Color(0, 255, 255));
		tabbedPane.setBackgroundAt(0, new Color(0, 0, 0));
		addPicturePanel.setLayout(null);
		addPicturePanel.setVisible(false);
		
		JLabel lblPicturename = new JLabel("PictureName");
		lblPicturename.setForeground(new Color(0, 206, 209));
		lblPicturename.setBounds(6, 28, 79, 16);
		addPicturePanel.add(lblPicturename);
		
		JLabel lblLocation = new JLabel("Location");
		lblLocation.setForeground(new Color(0, 255, 255));
		lblLocation.setBounds(205, 28, 61, 16);
		addPicturePanel.add(lblLocation);
		
		locationTextField = new JTextField();
		locationTextField.setBounds(266, 22, 101, 28);
		addPicturePanel.add(locationTextField);
		locationTextField.setColumns(10);
		
		JLabel lblTime = new JLabel("Time");
		lblTime.setForeground(new Color(0, 255, 255));
		lblTime.setBounds(379, 28, 39, 16);
		addPicturePanel.add(lblTime);
		
		timeTextField = new JTextField();
		timeTextField.setBounds(421, 22, 61, 28);
		addPicturePanel.add(timeTextField);
		timeTextField.setColumns(10);
		
		JLabel lblResoluiton = new JLabel("Resoluiton");
		lblResoluiton.setForeground(new Color(0, 255, 255));
		lblResoluiton.setBounds(16, 60, 67, 16);
		addPicturePanel.add(lblResoluiton);
		
		resolutionTextField = new JTextField();
		resolutionTextField.setBounds(92, 54, 101, 28);
		addPicturePanel.add(resolutionTextField);
		resolutionTextField.setColumns(10);
		
		JLabel lblSize = new JLabel("Size");
		lblSize.setForeground(new Color(0, 255, 255));
		lblSize.setBounds(379, 60, 39, 16);
		addPicturePanel.add(lblSize);
		
		JLabel lblPrice = new JLabel("Price");
		lblPrice.setForeground(new Color(0, 255, 255));
		lblPrice.setBounds(215, 60, 39, 16);
		addPicturePanel.add(lblPrice);
		
		priceTextField = new JTextField();
		priceTextField.setBounds(266, 54, 101, 28);
		addPicturePanel.add(priceTextField);
		priceTextField.setColumns(10);
		
		sizeTextField = new JTextField();
		sizeTextField.setBounds(421, 56, 61, 28);
		addPicturePanel.add(sizeTextField);
		sizeTextField.setColumns(10);
		
		JLabel lblSelectPicture = new JLabel("Select Picture");
		lblSelectPicture.setForeground(new Color(0, 255, 255));
		lblSelectPicture.setBounds(513, 40, 91, 16);
		addPicturePanel.add(lblSelectPicture);
		
		pictureNameTextField = new JTextField();
		pictureNameTextField.setForeground(new Color(0, 0, 0));
		pictureNameTextField.setBounds(92, 22, 101, 28);
		addPicturePanel.add(pictureNameTextField);
		pictureNameTextField.setColumns(10);
		
		JButton btnConfirmAddPic = new JButton("Confirm");
		btnConfirmAddPic.setBackground(new Color(0, 0, 0));
		btnConfirmAddPic.setForeground(new Color(0, 255, 255));
		btnConfirmAddPic.setBounds(551, 78, 117, 29);
		addPicturePanel.add(btnConfirmAddPic);
		
		addLayerPanel = new JPanel();
		addLayerPanel.setBackground(new Color(0, 0, 0));
		tabbedPane.addTab("Add a Layer", null, addLayerPanel, null);
		tabbedPane.setBackgroundAt(1, new Color(0, 0, 0));
		tabbedPane.setForegroundAt(1, new Color(0, 255, 255));
		addLayerPanel.setLayout(null);
		
		JLabel lblPictureid_1 = new JLabel("PictureID");
		lblPictureid_1.setForeground(new Color(0, 255, 255));
		lblPictureid_1.setBounds(16, 29, 61, 16);
		addLayerPanel.add(lblPictureid_1);
		
		picIDAddLayerTextField = new JTextField();
		picIDAddLayerTextField.setBounds(95, 23, 101, 28);
		addLayerPanel.add(picIDAddLayerTextField);
		picIDAddLayerTextField.setColumns(10);
		
		JLabel lblTypeAddLayer = new JLabel("Type");
		lblTypeAddLayer.setForeground(new Color(0, 255, 255));
		lblTypeAddLayer.setBounds(232, 29, 37, 16);
		addLayerPanel.add(lblTypeAddLayer);
		
		JComboBox typeAddLayercomboBox = new JComboBox();
		typeAddLayercomboBox.setForeground(Color.CYAN);
		typeAddLayercomboBox.setModel(new DefaultComboBoxModel(new String[] {"Road", "Electricity", "Water", "Business Maping"}));
		typeAddLayercomboBox.setBounds(269, 25, 88, 27);
		addLayerPanel.add(typeAddLayercomboBox);
		
		JButton btnConfirmAddLayer = new JButton("Confirm");
		btnConfirmAddLayer.setForeground(Color.CYAN);
		btnConfirmAddLayer.setBounds(369, 24, 117, 29);
		addLayerPanel.add(btnConfirmAddLayer);
		
		removePicturePanel = new JPanel();
		removePicturePanel.setBackground(new Color(0, 0, 0));
		tabbedPane.addTab("Remove a Picture", null, removePicturePanel, null);
		tabbedPane.setForegroundAt(2, new Color(0, 255, 255));
		tabbedPane.setBackgroundAt(2, new Color(0, 0, 0));
		tabbedPane.setDisabledIconAt(2, null);
		removePicturePanel.setLayout(null);
		
		JLabel lblPictureid = new JLabel("PictureID");
		lblPictureid.setForeground(new Color(0, 255, 255));
		lblPictureid.setBounds(26, 29, 57, 16);
		removePicturePanel.add(lblPictureid);
		
		picIDRemovePicTextField = new JTextField();
		picIDRemovePicTextField.setBounds(95, 23, 99, 28);
		removePicturePanel.add(picIDRemovePicTextField);
		picIDRemovePicTextField.setColumns(10);
		
		JButton btnConfirmRemovePic = new JButton("Confirm");
		btnConfirmRemovePic.setForeground(Color.CYAN);
		btnConfirmRemovePic.setBounds(207, 24, 117, 29);
		removePicturePanel.add(btnConfirmRemovePic);
		
		removeLayerpanel = new JPanel();
		removeLayerpanel.setBackground(new Color(0, 0, 0));
		tabbedPane.addTab("Remove a Layer ", null, removeLayerpanel, null);
		tabbedPane.setForegroundAt(3, new Color(0, 255, 255));
		tabbedPane.setBackgroundAt(3, new Color(0, 0, 0));
		removeLayerpanel.setLayout(null);
		
		JLabel lblPictureID_2 = new JLabel("PictureID");
		lblPictureID_2.setForeground(new Color(0, 255, 255));
		lblPictureID_2.setBounds(16, 29, 61, 16);
		removeLayerpanel.add(lblPictureID_2);
		
		picIDRemoveLayerTextField = new JTextField();
		picIDRemoveLayerTextField.setColumns(10);
		picIDRemoveLayerTextField.setBounds(95, 23, 101, 28);
		removeLayerpanel.add(picIDRemoveLayerTextField);
		
		JLabel lblTypeRemoveLayer = new JLabel("Type");
		lblTypeRemoveLayer.setForeground(new Color(0, 255, 255));
		lblTypeRemoveLayer.setBounds(232, 29, 37, 16);
		removeLayerpanel.add(lblTypeRemoveLayer);
		
		JComboBox typeRemoveLayercomboBox = new JComboBox();
		typeRemoveLayercomboBox.setForeground(Color.CYAN);
		typeRemoveLayercomboBox.setModel(new DefaultComboBoxModel(new String[] {"Road", "Electricity", "Water", "Business Maping"}));
		typeRemoveLayercomboBox.setBounds(269, 25, 88, 27);
		removeLayerpanel.add(typeRemoveLayercomboBox);
		
		JButton btnConfirmRemoveLayer = new JButton("Confirm");
		btnConfirmRemoveLayer.setForeground(Color.CYAN);
		btnConfirmRemoveLayer.setBounds(369, 24, 117, 29);
		removeLayerpanel.add(btnConfirmRemoveLayer);
		
		JLabel lblNewLabel = new JLabel("");
		lblNewLabel.setIcon(new ImageIcon(ArchieveWorkerWindow.class.getResource("/FramePictures/archiveworkerwindow.jpg")));
		lblNewLabel.setBounds(0, 0, 800, 578);
		contentPane.add(lblNewLabel);
	}
}
